﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainManager.master" AutoEventWireup="true" CodeFile="PageKyLuat.aspx.cs" Inherits="PageKyLuat" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">     
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
                        <div class="row-fluid">
                <div class="span12" id="divMsg" runat="server" visible="false">
                    <div class="alert" id="divAlert" runat="server"></div>
                </div>
            </div>
            <div class="row-fluid">

                <div class="span12">
                    <h3>Quản lý kỷ luật</h3>
                    <div class="well">
                        
                        <a id="btnDeleteAll" runat="server" onserverclick="btnDeleteAll_Click" class="btn btn-danger multidelete" >Xóa dòng được chọn</a>
                        <a href="#myModal" role="button" class="btn btn-primary" data-toggle="modal">Thêm mới</a>
                        <a href="#" class="btn btn-warning" id="btnRefresh" runat="server" onserverclick="btnRefresh_ServerClick"><i class="icon-refresh"></i></a>
                        <a class="btn disabled" runat="server" id="lblCount">Hiện đang có  mục trong CSDL.</a>
                    </div>

                    <asp:GridView ID="gvData" runat="server" GridLines="None"
                        AutoGenerateColumns="false" CssClass="table table-striped table-bordered"
                        DataKeyNames="ID" ShowFooter="false" AllowPaging="true">
                        <Columns>
                            <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="">
                                <HeaderTemplate>
                                    <input type="checkbox" id="check_all" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkSelect" runat="server" ClientIDMode="Static" />

                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Left" Width="10" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="ID"
                                HeaderText="#" HeaderStyle-Width="30" ReadOnly="true" />


                           

                            <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="Mức kỉ luật">
                                <ItemTemplate>
                                    <%# Eval("MucKiLuat") %>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtMucKiLuat" runat="server" Text='<%#Eval("MucKiLuat") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <HeaderStyle HorizontalAlign="Left"/>

                                
                            </asp:TemplateField>
                             <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="Mô tả">
                                <ItemTemplate>
                                    <%# Eval("MoTa") %>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtMoTa" runat="server" Text='<%#Eval("MoTa") %>' TextMode="MultiLine" CssClass="input-xxlarge"></asp:TextBox>
                                </EditItemTemplate>
                                <HeaderStyle HorizontalAlign="Left"/>

                                
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Xóa">
                                <HeaderStyle Width="20" HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="Delete" ToolTip="Xóa"
                                        Text="<i class='icon-trash'></i>" OnClientClick="return confirm('Bạn có chắc chắn xóa dòng này?')" />
                                </ItemTemplate>
                            </asp:TemplateField>
                           
                            <asp:CommandField HeaderText="Sửa" HeaderStyle-Width="10" ShowEditButton="True" EditText="<i class='icon-edit'></i>" UpdateText="<i class='icon-ok'></i>" CancelText="<i class='icon-remove'></i>" CausesValidation="false" ControlStyle-Width="10" />
                        </Columns>
                    </asp:GridView>

                </div>
            </div>


            <!-- Modal -->
            <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h3 id="myModalLabel">Thêm mới kỷ luật</h3>
                </div>
                <div class="modal-body">
                    <label>Mô tả</label>
                    <asp:TextBox ID="txtMoTa" runat="server" CssClass="input input-xlarge" TextMode="MultiLine"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="reTxt" runat="server" ErrorMessage="*" ForeColor="Red" ControlToValidate="txtMoTa">

                    </asp:RequiredFieldValidator>
                
                    <label>Mức kỷ luật</label>
                    <asp:TextBox ID="txtMucKyLuat" runat="server" CssClass="input input-xlarge" TextMode="MultiLine"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*" ForeColor="Red" ControlToValidate="txtMucKyLuat">

                    </asp:RequiredFieldValidator>
                </div>
                <div class="modal-footer">
                    <button class="btn" data-dismiss="modal" aria-hidden="true">Hủy</button>
                    <button class="btn btn-primary" id="btnSaveNew" runat="server" onserverclick="btnSaveNew_ServerClick">Lưu</button>
                </div>
            </div>

        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="gvData" />
        </Triggers>
    </asp:UpdatePanel>

</asp:Content>

